package org.t236.feign.user;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import org.t236.commons.model.AjaxResult;
import org.t236.commons.model.User;

/**
 * 声明user-service需要暴露的api接口列表
 */
@FeignClient(name = "user-service", /*fallback = UserRemoteClientFallback.class*/
    fallbackFactory = UserRemoteClientFallbackFactory.class)
public interface UserRemoteClient {
    @GetMapping("/users/{userId}")
    AjaxResult find(@PathVariable("userId") Long userId);

    @GetMapping("/users")
    AjaxResult findAll();

    @PostMapping("/users")
    AjaxResult add(@RequestBody User user);
}
